package com.ebocy.hammer.battle.fight.message;

import com.ebocy.hammer.core.constants.GameMessageCode;
import com.ebocy.hammer.core.message.AbstractS2CMessage;

public class S2CBrickMessage extends AbstractS2CMessage {
	private String playerId;
	private short x;
	private short y;
	private short endurance;

	public S2CBrickMessage(String playerId, short x, short y, short endurance) {
		this.playerId = playerId;
		this.x = x;
		this.y = y;
		this.endurance = endurance;
	}

	@Override
	protected void writeMessage() {
		writeString(this.playerId);
		writeShort(x);
		writeShort(y);
		writeShort(endurance);
	}

	@Override
	public short getMessageCode() {
		return GameMessageCode.BATTLE_BRICK;
	}

}
